<template>
	<view>
		<view class="msgBox" v-for="item in msgList">
			<view class="info">
			<view class="msgText">{{item.content}}</view>
				<view class="time">{{item.createtime}}</view>
			</view>
			
		</view>
		
		<view class="add" @click="addmsg"><image src="@/static/img/add.svg"></image></view>
	</view>
</template>

<script>
	import {request} from"@/api/request.js"
	export default {
		data() {
			return {
				msgList:[]
			};
		},
		
		onLoad() {
			// console.log("-----", basicConfig)
			
			var res = request({
				url: '/leavemsg/LeaveMsg',
				method:'GET',
				data:{}
			}).then(res =>{
				// console.log(res)
				if (res.code == 1){
					
					// console.log(res)
					this.msgList = res.data
				}
			})
			
			
			
			
			
		},
		methods: {
			addmsg(){
				uni.navigateTo({
					url:'/pages/addmsg/addmsg'
				})
			}
		}
	}
</script>

<style lang="scss">
	.add{
		image{
			width: 60rpx;
			height: 60rpx;
			position: fixed;
			bottom: 50rpx;
			right: 30rpx;
		}
		
	}
	.msgBox{
		width: 100%;
		display: flex;
		
		// flex-direction: column;
		justify-content: center;
		text-align: center;
		border-bottom: 1rpx dashed lightgray;
		.info{
			display: flex;
			flex-direction: column;
			width: 100%;
			padding: 30rpx 30rpx;
			.msgText{
					padding: 60rpx 60rpx;
					
			}
			.time{
				font-size: 15rpx;
				text-align: right;
				margin-right: 20rpx;
			}
		}
		
	}
</style>
